/*************************************************************************
    > File Name: AccountItem_test_002.cpp
    > Author: skylon
    > Site: blog.csdn.net/tcm_zhangpeng 
    > Created Time: 2016年05月15日 星期日 15时56分34秒
 ************************************************************************/

#include"AccountItem.h"
/*
 *	Create an account array, and store the information in the file
 *
 */
int main()
{	
	ofstream OutputStream("Account.in");	//	open the file you want to write
	vector<AccountItem> AllItems(100);
	short i;
	short AccountbookCount;	//	account number

	AllItems[0] = AccountItem("123456789", "topcoder", "Mark", 3258.71);	//	assign objects
	AllItems[1] = AccountItem("456123789", "topcoder", "Alian", 123.334);
	AllItems[2] = AccountItem("789123456", "topcoder", "Weiss", 999.445);
	AllItems[3] = AccountItem("987654321", "topcoder", "Bird", 7654.32);
	AllItems[4] = AccountItem("987123456", "topcoder", "Gilmore", 15.862);

	AccountbookCount = 5;
	for (i = 0; i < AccountbookCount; i++)	//	display information
	{
		AllItems[i].Display();
	}

	for (i = 0; i < AccountbookCount; i++)	//	write into the file
	{
		AllItems[i].Write(OutputStream);
	}
	return 0;
}
